package org.zjt.log.exception;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * DESC
 *
 * @author
 * @create 2017-06-20 上午11:35
 **/
public class InverseReducer extends Reducer<IntWritable,Text,Text,IntWritable> {

    @Override
    protected void reduce(IntWritable key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        /*values.forEach( a ->System.err.print(" "+a));
        System.err.println(key);*/

        values.forEach( a -> {
            try {
                context.write(a,key);
            }catch (Exception e){
                e.printStackTrace();
            }
        });


    }
}
